<?php
require_once __DIR__."/../vendor/autoload.php";

use Tests\Foundaction\Application;

#第一步:创建app应用实例
$app = new Application($_ENV['APP_BASE_PATH'] ?? dirname(__DIR__));

#第二步:绑定内核到app容器
$app->singleton('kernel',\Tests\Foundaction\Http\Kernel::class);
$kernel = $app->make('kernel',[$app]);
#开始处理请求
$kernel->handle();

var_dump(\Tests\Support\Facades\Router::getRouter());
#var_dump($app->make('index')->index());

#echo \Tests\Support\Facades\Index::hello();
#app('index')->hello();
//var_dump($app->make('app'));
//use App\Contracts\IndexContracts;
//use App\Controllers\IndexController;
//use Tests\Containers\Containers;
//
//$ioc = new Containers();
//
//$ioc->bind(IndexContracts::class,function(){
//    return new IndexController();
//});
//$ioc->make(IndexContracts::class)->hello();

//$ioc->singleton('index',IndexController::class);
//$ioc->bind('index',function(){
//    return new IndexController();
//});
//
//var_dump($ioc->getBindings());
//$ioc->make('index')->index();
//
//var_dump($ioc->getIn());
//
//#echo (new IndexController())->index();